package application;

import javafx.collections.ObservableList;
import javafx.concurrent.ScheduledService;
import javafx.concurrent.Task;

public class DanMuTask extends ScheduledService<ObservableList<DanmuData>>{

	private ConnectionDanMu conn;
	public DanMuTask(ConnectionDanMu conn) {
		this.conn=conn;
	}
	@Override
	protected Task<ObservableList<DanmuData>> createTask() {
		Task<ObservableList<DanmuData>> task=new Task<ObservableList<DanmuData>>() {
			
			@Override
			protected ObservableList<DanmuData> call() throws Exception {
				conn.connection();
				String data=conn.getDanMuData();
				ObservableList<DanmuData> list=conn.findData(data);
				return list;
			}
		};
		return task;
	}
}
